<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMerchantsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('merchants', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')->unique()->comment('用户id');
            $table->string('name',100)->comment('商户名字');
            $table->text('info')->nullable()->comment('商户介绍');
            $table->string('province',20)->comment("商户所在省份");
            $table->string('city',20)->comment("商户所在城市");
            $table->string('district',20)->comment("商户所在区/县/镇");
            $table->string('detail',200)->comment("商户所在详细地址（村，门牌号）");
            $table->integer('amount')->default(1)->comment("商户允许添加的商品数");
            $table->tinyInteger('type')->default(1)->comment("商户类别 1：个人  2：公司  3：平台");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('merchants');
    }
}
